import u from "../utils";
import { EXCEL } from "../constants";

const _api = u.api(EXCEL);

export default {
    saveFormAndField: data => _api('saveFormAndField', { type: 'post', data }),
    getExcelPages: appid => _api('getExcelPages', { data: { appid } }),
    pageInfo: id => _api('getExcelPageInfo', { data: { id } }),
    uploadData: data => _api('uploadData', { data, type: 'post' }),
    saveData: data => _api('saveData', { data, type: 'post' }),
    saveData2: data => _api('saveData2', { data, type: 'post' })
}

export const savePage = ({ id, name }) => _api(`page/${id}`, { data: { name }, type: 'post' });
export const deletePage = (id) => _api(`deletePage/${id}`, { type: 'post' });